<template>
  <div class="demo">
    <h2>我是子组件1:{{ msg }}</h2>
  </div>
</template>

<script setup lang="ts">
import mitter from '@utils/mittBus'
import { onMounted } from 'vue'
import { ref } from 'vue'

const msg = ref(null)

onMounted(() => {
  mitter.on('SendCar', (data) => {
    msg.value = data
  })
})
</script>

<style scoped>
.demo {
  display: flex;
  width: 200px;
  height: 200px;
  background: lightpink;
}
</style>
@/utils/mittBus
